from flask import Blueprint, request, jsonify
from flask_jwt_extended import jwt_required, get_jwt_identity

from app import system_upload_file, system_upload_b64, search_with_text
from app.services.ocr.service.controller import system_upload_file_ai

upload_bp = Blueprint('upload', __name__)


@upload_bp.route('/upload', methods=['POST'])
@jwt_required()
def upload():
    return system_upload_file(get_jwt_identity())


@upload_bp.route('/uploadAi', methods=['POST'])
@jwt_required()
def uploadAi():
    return system_upload_file_ai(get_jwt_identity())


@upload_bp.route('/upload64', methods=['POST'])
def upload64():
    return system_upload_b64()


@upload_bp.route('/searchText', methods=['GET'])
def upload_search():
    return search_with_text()
